package com.bw.day1homework

import android.os.Build
import androidx.annotation.RequiresApi
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import com.bw.cinema.CinemaDetailPage
import com.bw.cinema.CinemaPage
import com.bw.home.CommendPage
import com.bw.home.HomeDetailsPage
import com.bw.home.HomePage
import com.bw.home.LoginPage
import com.bw.home.ProfilePage
import com.bw.home.RegisterPage
import com.bw.home.UpdatePasswordPage
import com.bw.lib_common.NavPath
import com.bw.live.LivePage
import com.bw.mine.MinePage
import com.bw.publish.PublishDetailPage
import com.bw.publish.PublishPage


@RequiresApi(Build.VERSION_CODES.R)
@OptIn(ExperimentalFoundationApi::class)
@Composable
fun NavPage(navHostController: NavHostController, paddingValues: PaddingValues) {
    NavHost(
        navController = navHostController,
        startDestination = NavPath.HOME,
        Modifier.padding(paddingValues)
    ) {
        composable(NavPath.HOME) { HomePage(navHostController = navHostController) }
        composable(NavPath.CINEMA) { CinemaPage(navHostController = navHostController) }
        composable(NavPath.PUBLISH) { PublishPage(navHostController = navHostController) }
        composable(NavPath.LIVE) { LivePage(navHostController = navHostController) }
        composable(NavPath.MINE) { MinePage(navHostController = navHostController) }
        composable(NavPath.HOME_DETAILS) { HomeDetailsPage(navHostController = navHostController) }
        composable(NavPath.LOGIN) { LoginPage(navHostController = navHostController) }
        composable(NavPath.REGISTER) { RegisterPage(navHostController = navHostController) }
        composable(NavPath.UPDATE_PASSWORD) { UpdatePasswordPage(navHostController = navHostController) }
        composable(NavPath.CINEMA_DETAIL) { CinemaDetailPage(navHostController = navHostController) }
        composable(NavPath.PUBLISH_DETAIL) { PublishDetailPage(navHostController = navHostController) }
    }

}


@Composable
fun NavPage1(navHostController: NavHostController) {
    NavHost(navController = navHostController, startDestination = NavPath.SPLASH) {
        composable(NavPath.SPLASH) { SplashPage(navHostController = navHostController) }
        composable(NavPath.MAIN) { MainPage() }
    }
}